package com.kanesoft.android.gdx.screens;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL11;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.kanesoft.android.gdx.control.WorldControl;

public class SplashKIdeas implements Screen {

    private Texture splashTexture;
    private TextureRegion backgroundPicture;
    private SpriteBatch spriteBatch;
    private Game game;
    private long timeStarted;

    public SplashKIdeas(Game game) {
        spriteBatch = new SpriteBatch();
        splashTexture = new Texture(Gdx.files.internal("data/StartScreen.png"));
        backgroundPicture = new TextureRegion(splashTexture, 0, 0, 960, 540);

        timeStarted = System.currentTimeMillis();
        this.game = game;
    }

    @Override
    public void resume() {
        // TODO Auto-generated method stub

    }

    @Override
    public void render(float deltaTime) {

        Gdx.gl.glClear(GL11.GL_COLOR_BUFFER_BIT);
        Gdx.gl.glClearColor(1f, 1f, 1f, 0f);
        spriteBatch.begin();
        spriteBatch.draw(backgroundPicture, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
        spriteBatch.end();

        if (Gdx.input.isTouched()) {
            game.setScreen(new WorldControl());
        }

    }

    @Override
    public void resize(int width, int height) {
        // TODO Auto-generated method stub

    }

    @Override
    public void pause() {
        // TODO Auto-generated method stub

    }

    @Override
    public void dispose() {
        // TODO Auto-generated method stub

    }

    @Override
    public void show() {
        // TODO Auto-generated method stub

    }

    @Override
    public void hide() {
        // TODO Auto-generated method stub

    }

}
